import React, { memo } from "react";
import PropTypes from "prop-types";
import { AlbumCoverWrapper } from "./style";
import { fomatImgSizeY } from "@/utils/formatImgSize";

const AlbumCover = memo((props) => {
  const {item} = props;
  return (
    <AlbumCoverWrapper className="ShunCursor">
      <div className="top sprite_covor">
        <img src={fomatImgSizeY(item.artist.picUrl, 140)} alt="" />
      </div>
      <div className="bottom">
        <div className="title ShunEllipese">{item.name}</div>
        <div className="name ShunEllipese">{item.artist.name}</div>
      </div>
    </AlbumCoverWrapper>
  );
});
AlbumCover.propTypes = {
  item: PropTypes.object,
};
AlbumCover.defaultProps = {
  item: {},
};

export default AlbumCover;
